Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeepSpeed ZeRO Update #6546

Merged
merged 70 commits into from
Mar 30, 2021
Merged

DeepSpeed ZeRO Update #6546

merged 70 commits into from
Mar 30, 2021

Conversation

tchaton
Copy link
Contributor

@tchaton tchaton commented Mar 16, 2021

What does this PR do?

Adds DeepSpeed ZeRO 3 to the DeepSpeed plugin. Due to the nature of the plugin, we've had to make a few changes summarized below.

  • Plugin has to manage saving logic as DeepSpeed only supports non-elastic checkpointing; i.e if you train on 8 GPUs, you must load the model on 8 GPUs. This will be addressed over the coming weeks as PRs are merged into DeepSpeed
  • We've introduced a sharded context manager to create layers and shard them instantly.
  • DeepSpeed in ZeRO 3 has to wrap the model with optimizers even in inference. This is a limitation of DeepSpeed where the sharding logic is tied to the Optimizer, hence we only get proper sharding logic when an optimizer is passed through. Overall this means we have to allocate some memory to optimizer state (which is already done within training).

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Mar 16, 2021

Hello @tchaton! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-03-30 16:19:26 UTC

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #6546 (83e1343) into master (3c86193) will decrease coverage by 6%.
The diff coverage is 43%.

@@           Coverage Diff           @@
##           master   #6546    +/-   ##
=======================================
- Coverage      91%     86%    -6%     
=======================================
  Files         192     192            
  Lines       12231   12494   +263     
=======================================
- Hits        11184   10710   -474     
- Misses       1047    1784   +737     

@tchaton tchaton added this to the 1.3 milestone Mar 30, 2021
@tchaton tchaton enabled auto-merge (squash) March 30, 2021 17:27
@lexierule lexierule disabled auto-merge March 30, 2021 17:38
@lexierule lexierule merged commit 1302766 into master Mar 30, 2021
@lexierule lexierule deleted the feat/ds_update branch March 30, 2021 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Generic distributed-related topic feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants